declare FBS_ESC=`echo -en "\033"`;
declare FBS_EXTD="${FBS_ESC}[1m";


declare FBS_WARN="${FBS_ESC}[1;31m";    # warning,红色
declare FBS_DONE="${FBS_ESC}[1;32m";    # done,绿色
declare FBS_ATTN="${FBS_ESC}[1;33m";    # attention,黄色
declare FBS_HELP="${FBS_ESC}[1;36m";    # help,高亮明蓝色
declare FBS_PROMPT="${FBS_ESC}[1;37m";  # prompt,高亮白色
declare FBS_HEAD="${FBS_ESC}[7;37m";    # head,高亮白色，反显
declare FBS_CLOSED="${FBS_ESC}[0m";     # 颜色设置结束符号
declare FBS_NORM=`echo -en "${FBS_ESC}[m\017"`
declare FBS_STAT=`echo -en "\015${FBS_ESC}[${COLUMNS}C${FBS_ESC}[10D"`

if [ ! -d "build/" ];then
  mkdir build
fi
cd build
echo "${FBS_DONE}build BeagleBone makefile ...${FBS_CLOSED}"
cmake -D PLATFORM=arm-linux-gnueabihf -D DEBUG=ON ..

echo "${FBS_DONE}build BeagleBone ...${FBS_CLOSED}"
make
cd ..

if [ ! -f "build/BeagleBone" ];then
  echo "BeagleBone 不存在"
  exit 1
fi

echo "${FBS_DONE}copy to BeagleBone ... ${FBS_CLOSED}"
scp bulid/BeagleBone root@192.168.124.9:/root/BeagleBone